<div id="main" class="wrapper" style="position:relative;">
    <div id="home-body" class="container clearfix2">

        <div id="home-release-type-block">
            <ul id="home-release-type-nav" class="pinned">
                <li <?php if (!isset($ReleaseType) || $ReleaseType == 0) echo 'class="active"'; ?>><a href="<?php echo base_url('home') ?>">全部</a></li>
                <li <?php if (isset($ReleaseType) && $ReleaseType == 1) echo 'class="active"'; ?>><a href="<?php echo base_url('home/releaseType/1') ?>">全新</a></li>
                <li <?php if (isset($ReleaseType) && $ReleaseType == 2) echo 'class="active"'; ?>><a href="<?php echo base_url('home/releaseType/2') ?>">二手</a></li>
                <li <?php if (isset($ReleaseType) && $ReleaseType == 3) echo 'class="active"'; ?>><a href="<?php echo base_url('home/releaseType/3') ?>">赠送</a></li>
            </ul>
        </div>

        <?php if (isset($NowOffset) && $NowOffset === 0): ?>
            <div class="yime-block">
                <div id="carousel-main-ad" class="carousel slide" data-ride="carousel">
                    <ol id="carousel-main-ad-nav" class="carousel-indicators">
                        <li data-target="#carousel-main-ad" data-slide-to="0" class="active"></li>
                        <li data-target="#carousel-main-ad" data-slide-to="1"></li>
                        <li data-target="#carousel-main-ad" data-slide-to="2"></li>
                    </ol>

                    <div class="carousel-inner">
                        <div class="item active" data-index="0">
                            <img src="<?php echo base_url('public/banner/banner1.gif') ?>" alt="马上注册Yime" width="100%">
                        </div>
                        <div class="item" data-index="1">
                            <img src="<?php echo base_url('public/banner/banner2.gif') ?>" alt="我要认证" width="100%">
                        </div>
                        <div class="item" data-index="2">
                            <img src="<?php echo base_url('public/banner/banner5.gif') ?>" alt="关注Yime微博" width="100%">
                        </div>
                    </div>

                    <a class="left carousel-control" href="#carousel-main-ad" data-slide="prev">
                        <span class="glyphicon glyphicon-chevron-left"></span>
                    </a>
                    <a class="right carousel-control" href="#carousel-main-ad" data-slide="next">
                        <span class="glyphicon glyphicon-chevron-right"></span>
                    </a>
                </div>
            </div>
            <hr/>
        <?php endif; ?>

        <?php $this->load->view('modal/show-commodity-array') ?>
        <div class="clearfix"></div>
        <div id="pagination">
            <?php if (isset($Pagination)) echo $Pagination; ?>
        </div>
    </div>

    <div id="home-sidebar">
        <?php $this->load->view('home/home-sidebar'); ?>
    </div>

</div>

<script>
    $(document).ready(function () {
        $('#carousel-main-ad').on('slid.bs.carousel', function () {
            var activeIndex = $(this).find('.carousel-inner div.item.active').data('index');
            $(this).parent().find('ul.indicators li.active').removeClass('active');
            $(this).parent().find('ul.indicators li[data-slide-to=' + activeIndex + ']').addClass('active');
        });
        var $hrtb = $('#home-release-type-block');
        var hrtb_BaseTop = $hrtb.css('top').slice(0, -2);
        $(window).scroll(function () {
            $hrtb.css('top', ((Number)(hrtb_BaseTop) + $(window).scrollTop()) + 'px');
        });
    });
</script>
<!--右侧分类固定-->
<script>
    $(".pinned").pin({containerSelector: ".container"});
</script>
